Spindle system for diesink type electric discharge machine

ABSTRACT

The main spindle ( 1 A) for the main spindle device of a diesinker electric discharge machine is connected to a high rotor inertia, high output servo motor ( 15 ) without passing through a speed reducer; the servo motor ( 15 ) is equipped with a high resolution encoder ( 14 ). A main spindle rotation speed detection signal is detected by the encoder ( 14 ) when the main spindle ( 1 A) is rotating in the high speed mode, and a main spindle angle position and rotation speed detection signal are detected when the main spindle ( 1 A) is being angle divided, and these signals are fed back to the servo motor ( 15 ) motor driver ( 16 ). High speed rotational control and angle position precision angle division control are accomplished by a single servo motor and a single encoder.

FIELD OF THE INVENTION

The present invention relates to a main spindle device for a diesinktype electric discharge machine which machines a hole shape into aworkpiece by positioning an attached tool opposite a workpiece by acertain distance and applying a specific electric discharge voltagebetween the workpiece and the electrode. More particularly, the presentinvention relates to a main spindle device in which the main spindle maybe controlled both by high speed rotation control and by high precisionangle division control.

BACKGROUND OF THE INVENTION

In general, main spindle devices for electric discharge machines aremounted on a machining head, the in and out motion of which iscontrolled in the plumb (vertical) direction by a servo motor on acolumn mounted on a bed, with the tool electrode advancing in the depthdirection of the hole being machined in the workpiece. The toolelectrode is attached at the main spindle device main spindle lower end,and the workpiece is placed on a surface plate on top of a table mountedon the head. A machining vessel placed around the surface plate isfilled with a machining fluid which serves as an electric dischargemachining medium, and machining of the workpiece is carried out thereinin a submerged state.

It is advantageous when machining holes of various shapes using a mainspindle device of this type to be able to move the tool electrode notonly in and out in the advancing direction, but also to be able to turnthe electrode or the workpiece in the high speed mode around the mainspindle, or to angle divide in the rotational direction around thecenter axis of the main spindle. This makes it possible to performelectric discharge machining of machined holes having complex profilesby moving a round rod or other simple shaped tool electrode whilerotating it with respect to the workpiece, or to attain a desired anglewith respect to the workpiece using a tool electrode formed in a desiredshape, such that machining can be performed at a desired angle ofinclination. It is also possible, by combining main spindle angledivision and perpendicular in and out motion, to machine complexmachining holes such as screw holes.

Spindle devices in which such rotation control and angle divisioncontrol are possible have been utilized for some time, and have beendescribed in the patent literature. We shall now explain an example of aconventional main spindle device representative of such devices. In theexplanation below, the motion control axis of the main spindle in themachining depth direction is referred to as the Z axis, the motioncontrol axis in one axis direction on a plane perpendicular to the Zaxis is referred to as the X axis, and the motion control axis inanother axis direction perpendicular to the X axis on the aforementionedplane is referred to as the Y axis. Further, a rotation at approximately1,000 rpm, and preferably at approximately 3,000 rpm is referred to ashigh speed rotation, and the axis rotational direction control isreferred to as R axis control. Rotating the main spindle around the mainspindle center to precisely position it at a desired angular position isreferred to as angle division, and control of the rotational directionthereof in the control is referred to as C axis control. Rotation inthat case is of course at a slow speed.

An example of a main spindle device in which the above-describedoperations are possible is depicted in FIG. 4. In FIG. 4 there is a mainspindle device main unit 1; a main spindle 1A; a machining head 2; aservo motor 41; a rotary encoder 42; and a transfer mechanism 43 whichtransfers rotation of servo motor 41 to the main spindle. Explanation ofthe mechanism which moves the machining head 2 in and out, i.e. up anddown, in the Z axis direction is omitted.

A rotary encoder 44 is attached to the servo motor 41 and the rotationalspeed of the servo motor 41 is detected. The rotary encoder 44 detectsthe rotation of a servo motor, and therefore a rotary encoder resolutionof approximately 4,000 divisions (number of increments per degree) issufficient. The rotary encoder 42 for angle division is attached to themain spindle 1A on machining head 2, and the angular position of themain spindle 1A is detected. The rotary encoder 42 is also variouslyreferred to as the rotary scale and differs from devices normally placedon motors; a device having an extremely high resolution of, for example,360,000 divisions is used. The reason such extremely high resolutionrotary encoders or rotary scales are used is to respond to theparticular workpiece requirements of high angle division precision. Inparticular, in electric discharge machining such as the screw holemachining described above, servo control may performed in which the toolelectrode is controlled simultaneously in the Z axis and C axisdirections while maintaining a fixed gap between the tool electrode andthe workpiece, such that a much higher precision of angle division isrequired.

The transfer mechanism 43 comprises a coupling 43A affixed to the servomotor 41 output axis end, a pulley 43B affixed through the coupling 43Ato the servo motor 41 axial end, a timing belt 43D running between thepulleys 43B and 43C, and a worm wheel 43F affixed to a machining head 2.Rotation of the servo motor 41 is transferred to the worm 43E, whichcauses the worm wheel 43F to rotate; the main spindle 1A is deceleratedand rotates by means of the worm wheel 43F. As will be described below,that deceleration ratio is determined in accordance with the resolutionsof the rotary encoders 42 and 44. Therefore in the case, as above, of arotary encoder 42 having 360,000 divisions and a rotary encoder 44having 4,000 divisions, a 1/90 device is selected.

When the main spindle 1A is rotated in the high speed mode in such aconventional device, a feedback signal from the rotary encoder 44 isused to control the servo motor 41 such that the main spindle rotates ata desired speed. In this situation, no feedback signal from the rotaryencoder 42 is used.

Meanwhile, when angle dividing the main spindle 1A, the motor driver isswitched in order to validate the feedback signal from the rotaryencoder 42, which is used to control the angular position of the servomotor 41, while at the same time the feedback signal from the rotaryencoder 44 is used to control the angular position of the servo motor.The reason for using two encoders in this manner is to permit a speedreducer to be interposed between the main spindle 1A and the servo motor41. Due to the small amount of looseness, backlash, clutch slippage,etc. inherent in the speed reducer, control of the servo motor 41 doesnot immediately match that of the main spindle 1A, and therefore withoutfeedback control is not stable from the respective rotary encoders forthe servo motor 41 and the main spindle.

Feedback control using the two rotary encoders thus requires that therotary encoder 44 resolution and the rotary encoder 42 resolution bematched. In this conventional example, a speed reduction ratio of 1/90is selected, so the resolution of the 4,000 division rotary encoder 44has a converted resolution of 4,000×90=360,000 at the main spindle 1A.

Another example of a main spindle device in which the above-describedoperations are possible is depicted in FIG. 5. Parts which are the sameor similar as parts in the example described in FIG. 4 are given thesame reference numerals. This example uses the same technical concept asthe main spindle device disclosed in Laid Open Patent JP-H6-134624. InFIG. 5, there is depicted a main spindle device main unit 1; a mainspindle 1A; a spindle 18 which is an integral piece with the mainspindle 1A; a servo motor 51 for angle division; a rotary scale 52attached around the spindle 18; and a brake device 54 which holds themain spindle 1A at an angle position after angle division has beenperformed. As in the previous embodiment, a high resolution ofapproximately 360,000 divisions is used for the rotary scale 53, and4,000 divisions is used for the rotary encoder 52. A high rotation speedAC motor 55 is coupled to a speed reducer 56, which reduces speed at aspecific speed reduction ratio based on the difference in number ofteeth on inner and outer gears (not shown). The speed reduction ratio is1/90, as in the previous embodiment. A clutch 57 separates the upperside of the speed reducer 56 from the spindle 1A. A jet flow unit 58supplies a jet of machining fluid to the tool electrode.

When the main spindle 1A is rotating in the high speed mode, the servomotor 51 is separated from the spindle 1A by the clutch 57. At the sametime the AC motor 55 is controlled such that the main spindle rotates ata desired speed. Excessively fast rotation and burning loss of the servomotor 51 are thus prevented. At the same time, when angle division onmain spindle 1A is performed, the AC motor 55 is placed in anuncontrolled state, while the servo motor 51 is connected and controlledby the clutch 57. The motor driver for the servo motor 51 (not shown) iscontrolled; this motor driver controls the angular positioning of theservo motor 51 by means of the rotary scale 53 feedback signal, andcontrols the angular positioning of the servo motor 51 by means of therotary encoder 52 feedback signal. Thus the main spindle 1A ispositioned at a desired angular position. This example is similar to theprevious conventional example for those points which are under feedbackcontrol by the two rotary encoders.

However, problems with connections arise in the structure of theabove-described conventional examples. In the first conventionalexample, it is possible to switch the main spindle device between highspeed rotation and angle division by means of a single motor. However,when the speed reduction ratio is increased in order to achieve a higherangle division precision, a problem arises in that the main spindlecannot turn in the high speed mode using a high speed reduction ratio.In other words, in this conventional example, the main spindle devicerequires that one or the other of the high speed rotation or highprecision angle division functions be emphasized. In the secondconventional example, the high speed rotation control and the angledivision control can both be fully performed by switching between thetwo motors. However, the main spindle device requires 2 motors and 2motor drives, as well as a speed reducer and other parts such as aclutch. The main spindle device is complex, having a large number ofparts, in addition to being complex from a control standpoint.

Also, a speed reducer is used in both of the conventional examples, suchthat angle position control must be performed using a rotary encoder onthe servo motor side, in addition to the requirement for a highresolution rotary encoder when performing high precision angulardivision.

An objective of the present invention, therefore, is to provide a mainspindle device in which either high speed rotation control or highprecision angle division control may be selected using a single motorand a single encoder without the need for a speed reducer and which is,as a result, of a simpler and more compact structure.

SUMMARY OF THE INVENTION

A main spindle device according to the present invention, which is onepreferable embodiment for the purpose of achieving the and otherobjectives, may comprise the following elements; a machining headmounted so as to be able to travel in and out of a workpiece in amachining depth direction; a high output servo motor having a high rotorinertia in order to rotate the main spindle without decelerating; a highresolution angle position detector to detect the rotation speed andangular position of the servo motor for the main spindle; a numericalcontroller which outputs a switching signal to switch between high speedrotation of the above main spindle and angle division of the mainspindle, while outputting a speed command signal in response to adesired rotational speed when turning the main spindle in the high speedmode, and outputting a desired angle position command signal when angledividing the main spindle; and a motor driver which performs closed loopcontrol of the high rotational speed of the main spindle using the speedcommand signal and a feedback signal from the angle position detector,while also performing closed loop control of the main spindle angleposition using at least the angle position command signal and thefeedback signal from the angle position detector when angle dividing themain spindle.

In the main spindle device of this embodiment, the main spindle highprecision angle division and high speed rotation are controlled by asingle motor, a single motor driver, and a single encoder. The result isa simple structure in which the main spindle device does not require aspeed reducer.

In another preferred embodiment, a main spindle device machine accordingto the present invention comprises a main spindle placed on a machininghead mounted so as to be movable in and out of a workpiece in amachining depth direction; a high rotor inertia, high output servo motorwhich rotates the main spindle without decelerating; a high resolutionangle position detector mounted either on the servo motor or on the mainspindle, which detects the rotational speed and angle position of theservo motor or the main spindle; a numerical controller which outputs aswitching signal to switch between high speed rotation of the mainspindle and angle division of the main spindle, while at the same timeoutputting a speed command signal in accordance with a desiredrotational speed, and an angle position command signal for setting thedesired angle when angle dividing the main spindle; and a motor driverwhich, when rotating the main spindle in the high speed mode, performsspeed control through closed loop control of the servo motor by means ofthe speed command signal and a feedback signal, which is a signal fromthe angle position detector, the pulse count of which is reduced by aspecified proportion. When angle dividing the main spindle, closed loopcontrol of the main spindle angular position is performed by means of atleast the angular position command signal and the feedback signal fromthe angular position detector.

In the main spindle device of this embodiment, high precision angledivision and high speed rotation of the main spindle are controlled witha single motor, a single motor driver, and a single encoder, and asimple structure suffices wherein the main spindle device does notrequire a speed reducer. Also, the feedback signal pulse count isreduced, and the load on the motor driver is therefore reduced, as isthe occurrence of errors.

In yet another preferred embodiment, the motor driver of theabove-described main spindle device comprises a deviation output meanswhich, when angle dividing the main spindle, feeds back a signal fromthe angle position detector to the angle position command signal andoutputs the deviation thereof, and, when rotating the main spindle inthe high speed mode, does not feed back the signal from the angleposition detector to the rotation speed command signal; and asubtraction circuit which, when angle dividing of the main spindle,feeds back a signal from the angle position detector to the output ofthe position gain control element and outputs the deviation thereof,and, when rotating the main spindle in the high speed mode, feeds backthe signal from the angle detector to the rotational speed commandsignal and outputs the deviation thereof; and a speed gain controlelement which, when angle dividing the main spindle or when rotating inthe high speed mode, controls the outputs from the subtraction circuitat the respective desired speed gains and supplies an output.

According to this embodiment, when performing high speed control of themain spindle, a single servo motor controls the rotational speed bymeans of a feedback signal from a single angle position detector, whileat the same time, when controlling the main spindle by high precisionangle division, angular position is controlled by a single servo motorusing the feedback signal from a single angle position detector.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 is a structural diagram depicting the outline of the overallelectric discharge machine main spindle device of the present invention.

FIG. 2 is a sectional diagram depicting the main portions of theelectric discharge machine main spindle device of the present invention.

FIG. 3 is a block diagram depicting the motor driver of the electricdischarge machine main spindle device of the present invention.

FIG. 4 is a sectional diagram depicting an example of a conventionalelectric discharge machine main spindle device.

FIG. 5 is a sectional diagram depicting an example of anotherconventional electric discharge machine main spindle device.

PREFERRED EMBODIMENT OF THE INVENTION

An outline of the overall structure of an exemplary embodiment of anelectric discharge machine main spindle device of the present inventionis shown in FIG. 1. Below, the same parts or equivalent parts to thoseexplained above for the conventional technology will be explained usingthe same reference numerals. The machine includes a machining head 2; ashaping electric discharge machine main unit 3; a numerical controller 4used with the shaping electric discharge machine main unit; a machiningpower supply 5; a horizontally arranged bed 6; a column 7 verticallypositioned on the bed; a saddle 8 mounted so as to be movable in the Yaxis direction on the bed; a table 9 mounted on the saddle so as to bemovable in the X axis direction; and a machining vessel 10 attached tothe table. An input device 11 inputs data to the numerical controller 4,and may comprise a keyboard, mouse, and/or magnetic disk drive. The Xaxis and Y axis drive devices which drive the saddle 8 and the table 9are the same as in the conventional technology, and are therefore notdiagrammed. A servo motor 12 moves the machining head 2 in and out inthe Z axis direction; the speed of movement and position in the Z axisdirection are controlled by a feedback signal from a rotary encoder 13attached to the servo motor 12.

The main spindle device main unit 1 is provided within the machininghead 2. As is later detailed in connection to FIG. 2, the main spindledevice main unit 1 is equipped with a single servo motor 15, to which arotary encoder 14 is attached as an angle position detection device. Therotary encoder 14 is a high resolution encoder, having at leastapproximately 360,000 divisions. Therefore, when it is not attached tothe servo motor 15, it may be used as a rotary scale 53, integrallyaffixed to a spindle 18 as shown in FIG. 5. The rotary encoder 14feedback signal is input to the motor driver 16, as explained below inFIG. 3.

Rotational drive control for main spindle device main unit 1 is directby means of the servo motor 15, without mediation by a speed reducer. Ahigh output servo motor is therefore preferred for the servo motor 15.That is because the load inertia on the servo motor 15 when there is nospeed reducer is much larger than the load inertia when there is a speedreducer. Conventionally, when a speed reducer is used, the load inertiaplaced on the motor shaft is reduced by the speed reduction ratio of thespeed reducer. Assuming a load inertia of GDa² and a speed reductionratio of r1/r2, the motor shaft converted load inertia GDm² becomes(r1/r2)²×GDa². Therefore elimination of a speed reducer having, forexample, a reduction ratio of 1/2 prevents a reduction in the loadinertia placed on the servo motor 15 by 1/4, so the result is aquadrupling. Also, the load inertia which is controllable by the servomotor is limited as a ratio of the rotor inertia of the servo motoritself to the load inertia, and the servo motor 15 is thereforepreferably selected to be a motor having a relatively large rotor, sothat the proportion of load inertia to rotor inertia is not high.Preferably a servo motor having a high output as well as a relativelylarge rotor inertia is used as the servo motor 15 of the presentinvention.

The structure of the main portions of the shaping electric dischargemachine main spindle device main unit of the present invention are shownin FIG. 2. The,main spindle 1A is directly connected at its top endthrough a coupling to the rotating axis of the servo motor 15. A spindle18 is attached to the bottom end of the main spindle 1A, and a holder20, which holds the tool electrode E, is fit onto a fitting portion 19at the bottom of the spindle 18. The main spindle 1A and the spindle 18are separately described, but it is common for the main spindle and thespindle to be used as an integral piece, and the main spindle 1A and thespindle 18 may be viewed as single piece.

In electric discharge machining, stable machining is achieved byinterposing electric discharge machining fluid in the machining gapformed between the tool electrode E and the workpiece W. A jet flow unit21 is therefore provided, and machining fluid (supplied from a machiningfluid supply device not shown) is introduced from a jet flow injectionhole 21A, passes through a main spindle center hole 1B and a machiningfluid flow path 18A provided on the spindle 18, and is supplied to thetool electrode E. An oil pan 21B is attached around the machining head 2on the bottom side of the jet flow unit 21, the oil pan 21B receivesmachining fluid leaked from the jet flow unit 21 and ejects the leakedmachining fluid outside of the machining head 2.

In an electric discharge machine a current must be supplied from themachining power supply to the tool electrode E. A conducting brush 22 istherefore placed so as to rub against the spindle 18. A terminal onconducting wire 5A, which connects to one of the poles of the machiningpower supply 5, is screw-fastened thereto and passes machining currentto the tool electrode E through conductive components of the spindle 18(not depicted).

Furthermore, unlike conventional machining in which cutting tools suchas drills or blades are held in place, in electric discharge machines,tool electrodes having a relatively large size and weight and of allshapes may be used. The motor's stopping force when turned off istherefore not by itself enough to stop the rotation, and the mainspindle can frequently turn in the direction of rotation after angledivision. A brake device 23 is therefore placed concentrically with themain spindle 1A around the main spindle 1A. In the illustratedembodiment a disk brake is shown (as an example), which is relativelysimple in structure and strong in braking power. After angle division iscarried out and positioning is completed, the disk 23B is pinched by thebrake shoes 23A, and by holding the disk 23B still, the main spindle 1Ais held still.

A main spindle cooling device 24 is a device to cool the temperature ofthe tool electrode E due to heat from the electric discharges using acooling fluid such as the machining fluid, otherwise the electrodetemperature would tend to rise, and of the heat generated by therotation of the spindle 18 in the high speed mode. The cylinder 25 isfor the removal and attachment of the holder 20.

FIG. 3 illustrates the control system of the motor driver 16 whichcontrols the servo motor 15 of the present invention, and the controldevice thereof. The control system includes a numerical controller 4, asetting device 26, for example a RAM, which stores set values such asrotational speed and division angle position. In the numericalcontroller 4, a speed command signal is output at the same time as astart high speed rotation operation switch signal when the main spindleis under high speed rotation control. When angle division begins, onlythe angle position command signal is output. Of course the result is thesame even if at the time that the angle division operation begins theswitch signal indicating this is output, so for this embodiment theexplanation below assumes that a high speed rotation start switch signalis output. NC program data or other NC data from an input device 11 istemporarily stored in the setting device 26.

The motor driver 16 comprises a deviation counter, which is a means foroutputting deviation; a position gain control element KP; a subtractioncircuit 32; and a speed gain control element KV.

The deviation counter 31 calculates the deviation between the outputfrom the numerical controller 4 and the feedback signal from the rotaryencoder 14. In the deviation counter 31, the feedback signal from therotary encoder 14 is validated only when the motor driver 16 isperforming angle division control of the main spindle. The deviationbetween the angle position command signal from the rotary encoder 14 andthe feedback signal is generated in the deviation counter 31. When themotor driver 16 is performing high speed rotation control of the mainspindle, the feedback signal from the rotary encoder 14 is ignored andno processing takes place. The deviation counter 31 is a logic circuit,and may therefore be varied using equivalent circuits. A system may beconfigured to judge the deviation between command signals using the highspeed rotation signal and the angle division signal, so that noswitching signal to perform high speed rotation is required.

Position gain KP and speed gain KV are preset in the numericalcontroller 4 in accordance with the inertia and control speed, etc.which can be expected given the operating conditions of the mainspindle, the tool electrode, etc. In the present invention, as describedabove, there is no main spindle device speed reducer, so the loadinginertia falls directly on the servo motor shaft. The servo motor isselected to be one with a large rotor inertia, or of a high output, andthe position gain KP and speed gain KV are appropriately adjusted torelatively high values. Using this position gain KP and speed gain KV,the position deviation signal is amplified at the control element KP,and similarly the speed deviation signal is amplified at the controlelement KV. It is desirable in all cases to automatically switch andadjust the KV gain to low gain when the main spindle 1A is rotated inthe high speed mode, and the KP and KV gain to high gain when the mainspindle 1A is stopped to perform angle division. By so doing, vibrationoccurring at the switch-over from high speed rotation to angle divisionmay be prevented.

The subtracting circuit 32, like the deviation counter 31, outputs adeviation between two input values, so it outputs the deviation betweenthe output from the position gain control element KP and the speedfeedback signal from the rotary encoder 14. During angle division of themain spindle, speed control is carried out in accordance with the nextspeed gain control element KV, as well as the angle position and speeddeviations; minor loop control is performed in which speed is controlledsuch that the servo motor 15 does not exceed a specified speed. Duringhigh speed rotation control of the main spindle, a speed command signalis output from the numerical controller in place of outputting aposition deviation from the position gain control element KP. A speeddeviation is calculated using this speed command signal and the speedfeedback signal, and speed control of the servo motor 15 is performed inaccordance with the speed deviation using the next speed gain controlelement KV.

Referring now to FIGS. 1 through 3, the operational flow of the highspeed rotational control and angle division control of the main spindlein the main spindle device of the present invention will be explained.NC data including the high speed rotation speed or angle division angleposition is input from the input device 11 by means of an NC programstored on, for example, a magnetic disk, and temporarily stored on thesetting device 26. When operation of the electric discharge machinebegins, this rotational speed or angle division position is read intothe numerical controller 4, and output from the numerical controller 4to the motor driver 16.

When performing high speed rotation control of the main spindle, a speedcommand signal, along with the switchover signal which switches themotor driver 16 to high speed rotational control, is output to the servomotor 15 motor driver 16 from the numerical controller 4. This highspeed rotational control basically causes the main spindle to be rotatedat a fixed speed in a fixed direction, so that a speed command signalcorresponding to a desired analog voltage (e.g. 10V-0V DC) is generated.Speed control command based on a rotational speed, which is preset inthe setting device 26 after the switchover signal, is output to thedeviation counter 31. The deviation counter 31, into which theswitchover signal is first input does not accept input of the feedbacksignal from the rotary encoder 14, and does not output a deviationsignal. Similarly, nothing is done at the position gain control elementKP. Finally, the speed command signal is handed over to the subtractingcircuit 32. At the subtracting circuit 32, the switchover signal isreceived and the speed deviation between the speed command signal andthe speed feedback signal from the rotary encoder 14 is output, thenamplified in the next speed gain control element KV to perform speedcontrol.

Speed control is preferably performed in the following manner. Thecharacteristic of this control is that the pulse count of the pulsesignal which is fed back from the rotary encoder 14 to the subtractingcircuit 32 is reduced by sampling along its path. This reduced feedbacksignal is fed back to the subtracting circuit 32, and the servo motor 15is speed controlled by calculating the speed deviation between it andthe speed command signal. This reduction operation is easilyaccomplished by interposing an interface which uses only the pulsesignal from a particular detection phase of the rotary encoder as thespeed feedback signal, or by interposing an interface which reduces thefeedback signal pulse count by a fixed proportion.

This allows a reduction in driver errors and overloads due toexcessively large feedback pulse counts.

By speed controlling the main spindle in this manner, the main spindleis sufficiently rotationally controlled in the high speed mode using asingle servo motor and a single encoder, without passing through a speedreducer.

At the same time, when performing angle division control on the mainspindle, a pulse string up to the point at which the desired angleposition indicated by the NC data is reached is continuously output fromthe numerical controller 4 at an interval based on a rotational speedwhich is preset in the setting device 26. This is for the case when theangle position command signal is in a digital format, but control isessentially performed in the same way even with a data command format.During this angle division control, as described above, no switchoversignal to high speed rotation is input to the deviation counter 31 andtherefore the deviation counter 31 receives the position feedback signalfrom the rotary encoder 14 and outputs a position deviation signal.After being amplified by a specified position gain KP at the positiongain control element KP, this position deviation signal is further addedto or subtracted from in the subtracting circuit 32 by the speedfeedback signal from the rotary encoder 14. That deviation is thenamplified as the speed deviation by means of the speed gain KV in thespeed gain control element KV, and is output to the servo motor 15 asthe speed control signal. This speed feedback control is of course thepreviously mentioned minor loop control. The main spindle is thuspositioned to a desired angular position. When electric dischargemachining commences, the brake device 23 is normally automaticallyactivated, and the main spindle is held such that it does not drift fromthat position. When constantly servoing in the C axis direction, as withscrew machining, there is no need to activate the brake device.

By performing angle division control of the main spindle in this manner,the main spindle device of the present invention is able to accuratelyperform precision angle division control of the main spindle withoutpassing through a speed reducer, using a single motor and a singleencoder. As there is no need to provide a speed reducer on the mainspindle device, the main spindle device can be relatively simple instructure, and the machining head can be made compact and light weight,while the control system can be made simpler and less expensive.

The above-described present invention may be implemented in variousforms without departing from the spirit or requisite features thereof.Therefore the preferable embodiments described in the presentspecification are exemplary and should not be interpreted as limiting.

What is claimed is:
 1. A main spindle device for an electric dischargemachine having a machining head which is moveable in a Z-axis directionsaid device comprising a main spindle adapted to be mounted on themachining head whereby the spindle device will be movable in and out ofa workpiece in a machining depth direction; a high rotary inertia, highoutput servo motor for rotating the main spindle without decelerating; ahigh resolution angle position detector for detecting the rotationalspeed and the angle position of either of the servo motor or the mainspindle; a numerical controller for outputting a switchover signaloperable to switch the main spindle between a high speed rotation modeand an angle division mode, while outputting a speed command signalindicative of a desired rotational speed when rotating the main spindlein the high speed mode, or a desired angle position command signal whenrotating the main spindle in the angle dividing mode; a motor driverwhich, during rotation of the main spindle in the high speed mode,performs closed loop control of the main spindle rotational speed bymeans of the speed command signal and the feedback signal from the angleposition detector, and in angle division mode, performs closed loopcontrol of the main spindle angle position by means of at least theangle position command signal and the feedback signal from the angleposition detector.
 2. The main spindle device according to claim 1wherein the motor driver comprises a deviation output means which, whenrotating the main spindle in the angle dividing mode, feeds back thesignal from the angle position detector to the angle position commandsignal and outputs the deviation thereof and, when rotating the mainspindle in the high speed mode, feeds back the signal from the angleposition detector to the rotational speed command signal; a positiongain control element which controls at a desired position gain andoutputs the output from the deviation output means only when rotatingthe main spindle in the angle dividing mode; a subtracting circuitwhich, when rotating the main spindle in the angle dividing mode, feedsback a signal from the angle position detector to the output from theposition gain control element and controls the deviation thereof and,when rotating the main spindle in the high speed mode, feeds back thesignal from the angle position detector to the rotational speed commandsignal and controls the deviation thereof and; a speed gain controlelement which, when the main spindle is rotating in either the angledividing or the high speed rotating mode, controls the respectivedesired speed gains and outputs the outputs from the subtractingcircuit.
 3. A main spindle device for an electric discharge machinehaving a machining, head moveable in a Z-axis direction, said devicecomprising a main spindle adapted to be mounted on said machining headmovable in and out of the workpiece in the machining depth direction; ahigh rotary inertia, high output servo motor for rotating the mainspindle without decelerating; a high resolution angle position detectorassociated either with the servo motor or the main spindle, fordetecting the rotational speed and the angle position of either of theservo motor or the main spindle; a numerical controller which outputs aswitchover signal for switching between a high speed rotation mode andan angle division mode, while outputting a speed command signalindicative of a desired rotational speed when rotating the main spindlein the high speed mode, and a desired angle position command signal whenrotating the main spindle in the angle dividing mode; a motor driverwhich, when rotating the main spindle in the high speed mode, performsclosed loop control speed control of the servo motor by means of thespeed command signal and a feedback signal from the angle positiondetector from which a specified proportion of the pulse count thereofhas been subtracted, and, when rotating the main spindle in the angledividing mode, performs closed loop control of the main spindle angleposition by means of at least the angle position command signal and afeedback signal from the angle position detector.
 4. The spindle deviceaccording to claim 3 wherein the motor driver comprises a deviationoutput means which, when rotating the main spindle in the angle dividingmode, feeds back the signal from the angle position detector to theangle position command signal and outputs the deviation thereof and,when rotating the main spindle in the high speed mode, feeds back thesignal from the angle position detector to the rotational speed commandsignal; a position gain control element which controls at a desiredposition gain and outputs the output from the deviation output meansonly when rotating the main spindle in the angle dividing mode; asubtracting circuit which, when rotating the main spindle in the angledividing mode, feeds back a signal from the angle position detector tothe output from the position gain control element and controls thedeviation thereof and, when rotating the main spindle in the high speedmode, feeds back the signal from the angle position detector to therotational speed command signal and controls the deviation thereof and;a speed gain control element which, when the main spindle is rotating ineither the angle dividing or the high speed rotating mode, controls therespective desired speed gains and outputs the outputs from thesubtracting circuit.